<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>view/workArea/parts/partsDetail</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="../../../css/mui.min.css">
		<link rel="stylesheet" href="../../../css/global.css">
		<link rel="stylesheet" href="../../../css/style.css">

		<style>
			.details_con .clum {
			    height: 100%;
			}
			.details_con .clum .txt_cetail {
			    float: right;
			    color: #333333;
				margin-top: 10px;
				margin-bottom: 10px;
				line-height: 30px;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 id="title" class="mui-title">备件详情</h1>
		</header>
		<div class="mui-content">
			<div class="details_con">
				<div class="clum">
					<span class="name">备件号</span>
					<span class="txt_cetail" id="Part_no"></span>
				</div>
				<div class="clum">
					<span class="name">备件名称</span>
					<span  class="txt_cetail" id="Part_name"></span>
				</div>
				<div class="clum">
					<span class="name">服务编号</span>
					<span  class="txt_cetail" id="service_no"></span>
				</div>
				<div class="clum">
					<span class="name">备件状态</span>
					<span class="txt_cetail" id="Status"></span>
				</div>
				<div class="clum">
					<span class="name">备件备注</span>
					<span class="txt_cetail" id="Remark"></span>
				</div>
				<div class="clum">
					<span class="name">提交时间</span>
					<!-- TODO  没有呢！！！ -->
					<span class="txt_cetail" id="Create_Time"></span>
				</div>
				
				<!-- <div class="clum">
					<span class="name">备件名称</span>
					<input type="text" id="Part_name" class="d_ipt" readonly="readonly"/>
				</div> -->
				
				<div class="clum">
					<span class="name">发货DN号</span>
					<span class="txt_cetail" id="Borrow_dn"></span>
				</div>
				<div class="clum">
					<span class="name">借货单号</span>
					<span class="txt_cetail" id="Part_DebitNo"></span>
				</div>
				<div class="clum">
					<span class="name">借货用户名称</span>
					<span class="txt_cetail" id="CustName"></span>
				</div>
				<div class="clum">
					<span class="name">发货物流公司</span>
					<span class="txt_cetail" id="ExpressCompany"></span>
				</div>
				<div class="clum">
					<span class="name">发货运单号</span>
					<span class="txt_cetail" id="ExpressNumber"></span>
				</div>
				<div class="clum">
					<span class="name">发货时间</span>
					<span class="txt_cetail" id="Send_time"></span>
				</div>
				<div class="clum">
					<span class="name">还货条码</span>
					<span class="txt_cetail" id="Recode"></span>
				</div>
				<div class="clum">
					<span class="name">还货类型</span>
					<span class="txt_cetail" id="Return_type"></span>
				</div>
				<div class="clum">
					<span class="name">订货预计到货时间</span>
					<span class="txt_cetail" id="Order_expecttime"></span>
				</div>
				<div class="clum">
					<span class="name">还货运单号</span>
					<span class="txt_cetail" id="ReexpressNumber"></span>
				</div>
				<div class="clum">
					<span class="name">还货物流公司</span>
					<span class="txt_cetail" id="ReexpressCompany"></span>
				</div>
			</div>
			<div class="btn_box">
				<!-- <span class="fr">返回</span> -->
			</div>
			<div style="height: 50px;"></div>
		</div>

		<!-- js代码 start -->

		<!-- 基础js start -->
		<script src="../../../js/mui.min.js"></script>
		<script src="../../../js/utils/h.js"></script>
		<script src="../../../js/constant.js"></script>
		<script src="../../../js/common.js"></script>
		<script src="../../../js/utils/base64.js"></script>
		<script src="../../../js/utils/md5.js"></script>
		<script src="../../../js/utils/sortMap.js"></script>
		<script src="../../../js/utils/http.js"></script>
		<script src="../../../js/app.js"></script>
		<!-- 基础js end -->

		<script type="text/javascript" charset="utf-8">
			(function($, doc) {
				$.init();

				$.plusReady(function() {
					var self = plus.webview.currentWebview();
					var Part_id = self.Part_id; //推荐备件来的会传入serviceNo
					var enginnerId = self.enginnerId;
					if (!enginnerId) {
						enginnerId = app.getUser().enginnerId
					}
					selectList(Part_id, enginnerId);
				});
			}(mui, document));
			
			// 查询派单列表(使用post请求)
			function selectList(Part_id, enginnerId){
				app.showWaiting('加载中...')
				
				ajaxPost(BASE_URL + "cc/spareParts/queryPartByFseIdPost",{
					// "CustName": "",
					// "Status": "",
					// "enginner_id": enginnerId,
					"Part_id": Part_id
				},function(data) {
					app.closeWaiting()
					if (data.code === 200) {
						var str = '';
						var dataObj = JSON.parse(data.data);
						var list = dataObj.record;
						if (list.length > 0) {
							var info = list[0];
							//备件号
							h("#Part_no").html(info.Part_no);
							//备件名称
							h("#Part_name").html(emptyStr(info.Part_name));
							//发货DN号
							h("#Borrow_dn").html(emptyStr(info.Borrow_dn));
							//借货单号
							h("#Part_DebitNo").html(emptyStr(info.Part_DebitNo));
							//借货用户名称
							h("#CustName").html(emptyStr(info.CustName));
							//发货物流公司
							h("#ExpressCompany").html(emptyStr(info.ExpressCompany));
							//发货运单号
							h("#ExpressNumber").html(emptyStr(info.ExpressNumber));
							//发货时间
							h("#Send_time").html(emptyStr(info.Send_time));
							//备件状态
							h("#Status").html(partStatusName(info.Status));
							//还货类型
							h("#Return_type").html(emptyStr(info.Return_type));
							//订货预计到货时间
							h("#Order_expecttime").html(emptyStr(info.Order_expecttime));
							//还货运单号
							h("#ReexpressNumber").html(emptyStr(info.ReExpressNumber));
							//还货物流公司
							h("#ReexpressCompany").html(emptyStr(info.ReExpressCompany));
							//服务编号
							h("#service_no").html(emptyStr(info.service_no));
							//备件备注
							h("#Remark").html(emptyStr(info.Remark));
							//提交时间
							h("#Create_Time").html(emptyStr(info.Create_Time));
							//还货条码
							h("#Recode").html(emptyStr(info.Recode));
						} else {
							app.toast(dataObj.message)
						}
					} else {
						app.closeWaiting()
						app.toast(data.msg)
					}
				}, function(errorMsg) {
					app.toast(errorMsg)
				});
			}
			
		</script>
		<!-- js代码 end -->

	</body>

</html>
